Skip to main content

SetItalic

Sets the italic property to the text character.

Syntax

expression.SetItalic(isItalic);

expression - A variable that represents a ApiRange class.

Parameters

NameRequired/OptionalData typeDefaultDescription
isItalicRequiredbooleanSpecifies if the contents of the current Range are displayed italicized or not.

Returns

ApiRange | null

Example

This example sets the italic property to the text character.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("ONLYOFFICE Document Builder");
let range = doc.GetRange(0, 24);
range.SetItalic(true);